This is the code used to identify and cut out each of the lifts from the IMU’s data. This process has been repeated for each subject, and the resulting data is stored in separate csv files for further analysis. The process is described below
Lets load all functions from the previous chapter. This is a hassle since they are stored in Quarto markdown language, and R only accept real R code.
Code
# Clean workspacerm(list =ls())library(tidyr)library(dplyr)library(plotly)library(ggplot2)library(knitr)library(lubridate)# Most dependencies are loaded by loading datafiltering.qmd.# To load only the chuncks containing functions we need parsermdlibrary(parsermd)toload <-c("load_data","load_plots", "filter_data", "separate_lifts", "visualise_seperate_lifts")rmd <-parse_rmd("datafiltering.qmd")for (i inseq_along(toload)) { setup_chunk <-rmd_select(rmd, toload[i]) |>as_document() setup_chunk <- setup_chunk[-grep("```", setup_chunk)] setup_chunk#> [1] "library(tidyr)" "library(stringr)" "" eval(parse(text = setup_chunk)) }rm(rmd, i, setup_chunk, toload)
I’ve collected metadata about all recorded lift in liftinfo.csv. This can be used to easialy load the lifts: